dataset_type = 'PVDataset_forAdap'
data_root = 'data'
img_norm_cfg = dict(
    mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
crop_size = (384, 384)
train_pipeline = [
    dict(type='LoadImageFromFile_forAdap'),
    dict(type='LoadAnnotations', reduce_zero_label=True),
    dict(type='LoadAnnotations_B', reduce_zero_label=True),
    dict(type='LoadAnnotations_B_active', reduce_zero_label=True),
    dict(type='Resize', img_scale=(512, 512), ratio_range=(0.5, 2.0)),
    dict(type='RandomCrop', crop_size=(384, 384), cat_max_ratio=0.75),
    dict(type='RandomFlip', prob=0.5),
    dict(type='PhotoMetricDistortion'),
    dict(
        type='Normalize',
        mean=[123.675, 116.28, 103.53],
        std=[58.395, 57.12, 57.375],
        to_rgb=True),
    dict(type='Pad', size=(384, 384), pad_val=0, seg_pad_val=255),
    dict(type='DefaultFormatBundle'),
    dict(
        type='Collect',
        keys=[
            'img', 'B_img', 'gt_semantic_seg', 'B_gt_semantic_seg',
            'B_partial_semantic_seg'
        ])
]
test_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(
        type='MultiScaleFlipAug',
        img_scale=(512, 512),
        flip=False,
        transforms=[
            dict(type='Resize', keep_ratio=True),
            dict(type='RandomFlip'),
            dict(
                type='Normalize',
                mean=[123.675, 116.28, 103.53],
                std=[58.395, 57.12, 57.375],
                to_rgb=True),
            dict(type='ImageToTensor', keys=['img']),
            dict(type='Collect', keys=['img'])
        ])
]
ada_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(type='LoadAnnotations', reduce_zero_label=False),
    dict(
        type='MultiScaleFlipAug',
        img_scale=(512, 512),
        flip=False,
        transforms=[
            dict(type='Resize', keep_ratio=True),
            dict(type='RandomFlip'),
            dict(
                type='Normalize',
                mean=[123.675, 116.28, 103.53],
                std=[58.395, 57.12, 57.375],
                to_rgb=True),
            dict(type='ImageToTensor', keys=['img']),
            dict(type='Collect', keys=['img', 'gt_semantic_seg'])
        ])
]
data = dict(
    samples_per_gpu=3,
    workers_per_gpu=3,
    train=dict(
        type='PVDataset_forAdap',
        data_root='data',
        img_dir='Potsdam_IRRG_DA/img_dir/train',
        ann_dir='Potsdam_IRRG_DA/ann_dir/train',
        split='Potsdam_IRRG_DA/train.txt',
        B_img_dir='Vaihingen_IRRG_DA/img_dir/train',
        B_ann_dir='Vaihingen_IRRG_DA/ann_dir/train',
        B_split='Vaihingen_IRRG_DA/train.txt',
        B_coco_mask_dir='Vaihingen_IRRG_DA/auto_mask_dir/train',
        pipeline=[
            dict(type='LoadImageFromFile_forAdap'),
            dict(type='LoadAnnotations', reduce_zero_label=True),
            dict(type='LoadAnnotations_B', reduce_zero_label=True),
            dict(type='LoadAnnotations_B_active', reduce_zero_label=True),
            dict(type='Resize', img_scale=(512, 512), ratio_range=(0.5, 2.0)),
            dict(type='RandomCrop', crop_size=(384, 384), cat_max_ratio=0.75),
            dict(type='RandomFlip', prob=0.5),
            dict(type='PhotoMetricDistortion'),
            dict(
                type='Normalize',
                mean=[123.675, 116.28, 103.53],
                std=[58.395, 57.12, 57.375],
                to_rgb=True),
            dict(type='Pad', size=(384, 384), pad_val=0, seg_pad_val=255),
            dict(type='DefaultFormatBundle'),
            dict(
                type='Collect',
                keys=[
                    'img', 'B_img', 'gt_semantic_seg', 'B_gt_semantic_seg',
                    'B_partial_semantic_seg'
                ])
        ],
        ada_args=dict(
            save_dir=
            './checkpoints/deeplabv3plus/Potsdam2Vaihingen_results_ada/deeplabv3plus_r50-d8_4x4_512x512_40k_ADA_0.022_40_normalize2_region_relate_entropy&impurity_k=7/',
            active_api='read')),
    ada=dict(
        type='PVDataset_forAdap',
        data_root='data',
        img_dir='Vaihingen_IRRG_DA/img_dir/train',
        ann_dir='Vaihingen_IRRG_DA/ann_dir/train',
        split='Vaihingen_IRRG_DA/train.txt',
        pipeline=[
            dict(type='LoadImageFromFile'),
            dict(type='LoadAnnotations', reduce_zero_label=False),
            dict(
                type='MultiScaleFlipAug',
                img_scale=(512, 512),
                flip=False,
                transforms=[
                    dict(type='Resize', keep_ratio=True),
                    dict(type='RandomFlip'),
                    dict(
                        type='Normalize',
                        mean=[123.675, 116.28, 103.53],
                        std=[58.395, 57.12, 57.375],
                        to_rgb=True),
                    dict(type='ImageToTensor', keys=['img']),
                    dict(type='Collect', keys=['img', 'gt_semantic_seg'])
                ])
        ],
        ada_args=dict(
            default=2,
            al=2,
            kl=1,
            save_dir=
            './checkpoints/deeplabv3plus/Potsdam2Vaihingen_results_ada/deeplabv3plus_r50-d8_4x4_512x512_40k_ADA_0.022_40_normalize2_region_relate_entropy&impurity_k=7/',
            active_api='write',
            num_classes=6,
            mode='TEST',
            pixels=40,
            ratio=0.022,
            radius=7,
            sample_way='total',
            sample_num=4)),
    val=dict(
        type='PVDataset_forAdap',
        data_root='data',
        img_dir='Vaihingen_IRRG_DA/img_dir/val',
        ann_dir='Vaihingen_IRRG_DA/ann_dir/val',
        split='Vaihingen_IRRG_DA/val.txt',
        pipeline=[
            dict(type='LoadImageFromFile'),
            dict(
                type='MultiScaleFlipAug',
                img_scale=(512, 512),
                flip=False,
                transforms=[
                    dict(type='Resize', keep_ratio=True),
                    dict(type='RandomFlip'),
                    dict(
                        type='Normalize',
                        mean=[123.675, 116.28, 103.53],
                        std=[58.395, 57.12, 57.375],
                        to_rgb=True),
                    dict(type='ImageToTensor', keys=['img']),
                    dict(type='Collect', keys=['img'])
                ])
        ]),
    test=dict(
        type='PVDataset_forAdap',
        data_root='data',
        img_dir='Vaihingen_IRRG_DA/img_dir/val',
        ann_dir='Vaihingen_IRRG_DA/ann_dir/val',
        split='Vaihingen_IRRG_DA/val.txt',
        pipeline=[
            dict(type='LoadImageFromFile'),
            dict(
                type='MultiScaleFlipAug',
                img_scale=(512, 512),
                flip=False,
                transforms=[
                    dict(type='Resize', keep_ratio=True),
                    dict(type='RandomFlip'),
                    dict(
                        type='Normalize',
                        mean=[123.675, 116.28, 103.53],
                        std=[58.395, 57.12, 57.375],
                        to_rgb=True),
                    dict(type='ImageToTensor', keys=['img']),
                    dict(type='Collect', keys=['img'])
                ])
        ]))
log_config = dict(
    interval=50, hooks=[dict(type='TextLoggerHook', by_epoch=False)])
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = None
resume_from = None
workflow = [('train', 1)]
cudnn_benchmark = True
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
    type='EncoderDecoderADABase',
    pretrained='open-mmlab://resnet50_v1c',
    backbone=dict(
        type='ResNetV1c',
        depth=50,
        num_stages=4,
        out_indices=(0, 1, 2, 3),
        dilations=(1, 1, 2, 4),
        strides=(1, 2, 1, 1),
        norm_cfg=dict(type='SyncBN', requires_grad=True),
        norm_eval=False,
        style='pytorch',
        contract_dilation=True),
    decode_head=dict(
        type='DepthwiseSeparableASPPHead',
        in_channels=2048,
        in_index=3,
        channels=512,
        dilations=(1, 12, 24, 36),
        c1_in_channels=256,
        c1_channels=48,
        dropout_ratio=0.1,
        num_classes=6,
        norm_cfg=dict(type='SyncBN', requires_grad=True),
        align_corners=False,
        loss_decode=dict(
            type='CrossEntropyLoss',
            use_sigmoid=False,
            reduction='none',
            loss_weight=1.0,
            class_weight=[1.0, 1.0, 1.0, 1.25, 1.5, 1.5])),
    train_cfg=dict(),
    test_cfg=dict(mode='whole'))
lr_config = dict(policy='poly', power=0.9, min_lr=1e-05, by_epoch=False)
optimizer = dict(
    backbone=dict(type='SGD', lr=0.001, momentum=0.9, weight_decay=0.0005),
    decode_head=dict(type='SGD', lr=0.002, momentum=0.9, weight_decay=0.0005))
total_iters = 50000
check_iters = 2500
sample_iters = 10000
ada_super_args = dict(
    mode='TEST',
    pixels=40,
    ratio=0.022,
    radius=7,
    sample_way='total',
    sample_num=4)
work_dir = './checkpoints/deeplabv3plus/Potsdam2Vaihingen_results_ada/deeplabv3plus_r50-d8_4x4_512x512_40k_ADA_0.022_40_normalize2_region_relate_entropy&impurity_k=7/'
checkpoint_config = dict(by_epoch=False, interval=2500)
ada_fixed_args = dict(
    default=2,
    al=2,
    kl=1,
    save_dir=
    './checkpoints/deeplabv3plus/Potsdam2Vaihingen_results_ada/deeplabv3plus_r50-d8_4x4_512x512_40k_ADA_0.022_40_normalize2_region_relate_entropy&impurity_k=7/',
    active_api='write',
    num_classes=6)
ada_args = dict(
    default=2,
    al=2,
    kl=1,
    save_dir=
    './checkpoints/deeplabv3plus/Potsdam2Vaihingen_results_ada/deeplabv3plus_r50-d8_4x4_512x512_40k_ADA_0.022_40_normalize2_region_relate_entropy&impurity_k=7/',
    active_api='write',
    num_classes=6,
    mode='TEST',
    pixels=40,
    ratio=0.022,
    radius=7,
    sample_way='total',
    sample_num=4)
evaluation = dict(interval=2500, metric=['mIoU', 'mFscore'], pre_eval=False)
ada_evaluation = dict(
    interval=10000, metric=['mIoU', 'mFscore'], pre_eval=True)
runner = dict(type='IterBasedRunner', max_iters=50000)
find_unused_parameters = True
gpu_ids = [0]
auto_resume = False
